package com.example.demo.book.resu;

import com.example.demo.commons.entity.Student;
import com.example.demo.commons.result.ResultVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author root
 * @date 2021-01-25 13:22
 */
@RestController
@Slf4j
public class BookRest {


    @GetMapping("test")
    public String get(@RequestParam String name) {
        log.info("get 调用 {}", name);
        return "get   " + name;
    }


    @GetMapping("getStudent")
    public ResultVo<Student> getStudent() {

        return ResultVo.success(Student.builder().age(11).name("123").build());
    }
}
